<?php
include 'auth/ceklogin.php';
include 'sql/conn.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Bukaka Inti - An Airconditioning Company - test subversion - inul</title>
    <link rel="stylesheet" type="text/css" href="themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="themes/icon.css">
    <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="js/datagrid-detailview.js"></script>
    <script type="text/javascript">
        var index = 0;
        function addTab(nmMenu,url){
            index++;
            if ($('#tt').tabs('exists', nmMenu)){
                $('#tt').tabs('select', nmMenu);
            } else {
                $('#tt').tabs('add',{
                    title: nmMenu,
                    href:'pages/'+url+'/'+url+'.php',
                    closable:true
                });
            }
        }
        function logout(){
            location.href='auth/logout.php';
        }
    </script>
</head>
<body class="easyui-layout">
    <div region="north" style="height:100px;">
<!--        <img src="images/logobukakainti.jpg">-->
        <div style="float:right;padding:10px;">
            You're Looged in as <?php echo $_SESSION['userbkknt'];?>
            <a href="javascript:void(0)" onclick="logout()">LogOut</a>
        </div>
    </div>
    <div region="west" title="Menu" split="false" style="width:180px;padding:10px;overflow:hidden;">
        <ul id="tt1" class="easyui-tree" animate="true">
            <?php
            $query_ambilmenuuser=mysql_query("select menu.* from menu,menu_role,user where menu_role.role=user.role and menu.pathMenu=menu_role.pathMenu and user.uname = '$_SESSION[userbkknt]'");
            if($query_ambilmenuuser){
            while($row_menu=mysql_fetch_array($query_ambilmenuuser)){
                echo '
                        <li>
                            <a href="javascript:void(0)" onclick=\'addTab("'.$row_menu['judulMenu'].'","'.$row_menu['pathMenu'].'")\'>'.$row_menu['namaMenu'].'</a>
                        </li>
                    ';
            }
            }else{
                echo "error".mysql_error();
            }
            ?>
        </ul>
    </div>
    <div region="center" title="" style="overflow:hidden;">
	<div id='tt' class='easyui-tabs' border='false'>
		<div title='Main Menu' style='padding-top: 10px;padding-left: 10px'>
                    <h1>Welcome</h1>
		</div>
	</div>
    </div>
    <div region="south" align="right" style="padding:5px;background:#efefef;">Designed by nullz
    </div>
</body>
</html>